home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / programming / amos / amoslist-0399 / amoslist / 000176_nobody_Sun Mar 21 07:43:59 1999.msg < prev    next >
Internet Message Format  |  1999-05-17  |  3KB

  1. Received: from onelist.com (pop.onelist.com [209.207.164.159])
  2.     by osf1.gmu.edu (8.8.8/8.8.8) with SMTP id HAA15388
  3.     for <mcox4@osf1.gmu.edu>; Sun, 21 Mar 1999 07:43:59 -0500 (EST)
  4. Received: (qmail 21171 invoked by alias); 21 Mar 1999 12:44:30 -0000
  5. Received: (qmail 21163 invoked from network); 21 Mar 1999 12:44:29 -0000
  6. Received: from unknown (HELO mail.enterprise.net) (194.72.192.18) by pop.onelist.com with SMTP; 21 Mar 1999 12:44:29 -0000
  7. Received: from enterprise.net (andrewcrowe@max04-061.enterprise.net [194.72.196.181]) by mail.enterprise.net (8.8.5/8.8.5) with SMTP id MAA12760 for <amos-list@onelist.com>; Sun, 21 Mar 1999 12:43:55 GMT
  8. From: Andrew Crowe <andrewcrowe@enterprise.net>
  9. To: amos-list@onelist.com
  10. Date: Sun, 21 Mar 1999 12:40:21 +0000
  11. Message-ID: <yam7749.1066.1198495760@mail.enterprise.net>
  12. In-Reply-To: <yam7749.1224.2014945600@mail.flashback.net>
  13. X-Mailer: YAM 2.0Preview7 [020] - Amiga Mailer by Marcel Beck - http://www.yam.ch
  14. Mailing-List: list amos-list@onelist.com; contact amos-list-owner@onelist.com
  15. Delivered-To: mailing list amos-list@onelist.com
  16. Precedence: bulk
  17. List-Unsubscribe: <mailto:amos-list-unsubscribe@ONElist.com>
  18. Reply-to: amos-list@onelist.com
  19. Mime-Version: 1.0
  20. Content-Type: text/plain
  21. Subject: [amos-list] Re: box
  22. Status: O
  23. X-Status: 
  24.  
  25. From: Andrew Crowe <andrewcrowe@enterprise.net>
  26.  
  27. Hi Everybody,
  28.  
  29. > I want to draw a box on an iff screen and 
  30. > use the mouse to change the size of the box,
  31. > like in a paintprogram.
  32.  
  33. '
  34. 'Boxy Boxy, by Andrew Crowe <andrewcrowe@enterprise.net> 
  35. '
  36. '
  37. ' Just insert this in the approprate place.
  38. '
  39. '
  40.  
  41.  
  42. '''''''''''''''''''''''''''''''''
  43.  
  44. Limit Mouse 0
  45. For A=0 To 1000
  46.    F Plot Rnd(320),Rnd(200),Rnd(15)
  47. Next 
  48.  
  49. TMPB=1 : Rem unused bob number
  50.  
  51. C=4 : Rem colour 
  52.  
  53. SX=Screen Width
  54. SY=Screen Height
  55.  
  56. Repeat 
  57.    
  58.    Gr Writing 2
  59.    X=X Screen(X Mouse)
  60.    Y=Y Screen(Y Mouse)
  61.    
  62.    Draw X,SY To X,0
  63.    Draw SX,Y To 0,Y
  64.    
  65.    Repeat 
  66.       Wait Vbl 
  67.       X2=X Screen(X Mouse)
  68.       Y2=Y Screen(Y Mouse)
  69.    Until X2<>X or Y2<>Y
  70.    
  71.    Draw X,SY To X,0
  72.    Draw SX,Y To 0,Y
  73.    
  74. Until Mouse Key=1
  75.  
  76.  
  77. Repeat 
  78.    
  79.    Gr Writing 1
  80.    DX=X Screen(X Mouse)
  81.    DY=Y Screen(Y Mouse)
  82.    
  83.    DX2=Max(DX,X)
  84.    DY2=Max(DY,Y)
  85.    X2=Min(DX,X)
  86.    Y2=Min(DY,Y)
  87.    
  88.    If DX2>X2 and DY2>Y2
  89.       Get Bob TMPB,X2,Y2 To DX2+1,DY2+1
  90.       Ink C : Bar X2,Y2 To DX2,DY2
  91.       Repeat 
  92.          Wait Vbl 
  93.          X3=X Screen(X Mouse)
  94.          Y3=Y Screen(Y Mouse)
  95.       Until X3<>DX or Y3<>DY
  96.       Paste Bob X2,Y2,TMPB
  97.    End If 
  98.    
  99. Until Mouse Key=0
  100.  
  101. If DX2>X2 and DY2>Y2
  102.    Ink C : Bar X2,Y2 To DX2,DY2
  103. End If 
  104.  
  105.  
  106. '''''''''''''''''''''''''''''''''''''''
  107.  
  108.  
  109.    There you go, hope it helps
  110.  
  111. See ya.
  112. -- 
  113.        Manta Soft  -  Amiga programing & web page designing
  114.    Http://members.tripod.com/~mantasoft/              ICQ: 21829166
  115.   - --------------------- Quote of the day: ---------------------- -
  116. Its the same room but everythings different, you can find the
  117. sleep but not the dream...
  118. -- Crowded House
  119.  
  120.  
  121.  
  122. ------------------------------------------------------------------------
  123. Come check out our brand new web site!
  124. http://www.onelist.com
  125. Onelist: Making the Internet intimate
  126. ------------------------------------------------------------------------
  127. Official AMOS WWW: http://members.xoom.com/AmosFactory/front.html